Skip to content

Conversation

@18202781743
Copy link
Contributor

  1. Added Qt6 version checks for touch/mouse event handling with new API
    (globalPosition vs screenPos)
  2. Marked DNativeSettings, DPlatformSettings and DXcbXSettings classes
    as Q_DECL_HIDDEN
  3. Replaced QGuiApplication::fontChanged signal with event filter for
    Qt6 compatibility
  4. Updated type checking from QVariant::type() to typeId() for Qt6
  5. Fixed window geometry calculations for Qt6 mouse position handling
  6. Adjusted DHighDpi initialization logic for Qt6 where high DPI is
    always enabled
  7. Added proper private section to DPlatformSettings class

fix: 添加Qt6兼容性并解决编译警告

  1. 为触摸/鼠标事件处理添加Qt6版本检查,使用新API(globalPosition替
    代screenPos)
  2. 将DNativeSettings、DPlatformSettings和DXcbXSettings类标记为
    Q_DECL_HIDDEN
  3. 为Qt6兼容性使用事件过滤器替代QGuiApplication::fontChanged信号
  4. 将类型检查从QVariant::type()更新为typeId()以兼容Qt6
  5. 修复Qt6鼠标位置处理的窗口几何计算
  6. 调整DHighDpi初始化逻辑以适应Qt6中始终启用高DPI的情况
  7. 为DPlatformSettings类添加适当的私有部分

1. Added Qt6 version checks for touch/mouse event handling with new API
(globalPosition vs screenPos)
2. Marked DNativeSettings, DPlatformSettings and DXcbXSettings classes
as Q_DECL_HIDDEN
3. Replaced QGuiApplication::fontChanged signal with event filter for
Qt6 compatibility
4. Updated type checking from QVariant::type() to typeId() for Qt6
5. Fixed window geometry calculations for Qt6 mouse position handling
6. Adjusted DHighDpi initialization logic for Qt6 where high DPI is
always enabled
7. Added proper private section to DPlatformSettings class

fix: 添加Qt6兼容性并解决编译警告

1. 为触摸/鼠标事件处理添加Qt6版本检查,使用新API(globalPosition替
代screenPos)
2. 将DNativeSettings、DPlatformSettings和DXcbXSettings类标记为
Q_DECL_HIDDEN
3. 为Qt6兼容性使用事件过滤器替代QGuiApplication::fontChanged信号
4. 将类型检查从QVariant::type()更新为typeId()以兼容Qt6
5. 修复Qt6鼠标位置处理的窗口几何计算
6. 调整DHighDpi初始化逻辑以适应Qt6中始终启用高DPI的情况
7. 为DPlatformSettings类添加适当的私有部分
deepin-ci-robot added a commit to linuxdeepin/qt6platform-plugins that referenced this pull request Jul 28, 2025
Synchronize source files from linuxdeepin/qt5platform-plugins.

Source-pull-request: linuxdeepin/qt5platform-plugins#297
@18202781743 18202781743 requested a review from mhduiy July 28, 2025 05:27
@deepin-ci-robot
Copy link
Contributor

deepin pr auto review

代码审查意见:

  1. DDesktopInputSelectionControl::eventFilter函数中,QMouseEventscreenPos()globalPosition()在Qt 6中已经被弃用,应该使用position()globalPosition()代替。建议更新这些调用以保持代码的兼容性。

  2. DSelectedTextTooltip类中,eventFilter函数用于处理QEvent::ApplicationFontChange事件,但在Qt 6中,QGuiApplication::fontChanged信号已经被弃用,应该使用QGuiApplication::font()函数来获取当前字体,并手动更新UI。

  3. DXcbXSettingsPrivate类中,switch语句用于处理不同类型的QVariant值。在Qt 6中,QMetaType::typeId()应该被使用来代替QMetaType::type(),以保持代码的兼容性。

  4. DFrameWindow类中,mouseMoveEvent函数中使用了event->x()event->y()来获取鼠标位置,但在Qt 6中,应该使用event->position().x()event->position().y()来代替,以保持代码的兼容性。

  5. DHighDpi类的init函数中,在Qt 6中,高DPI缩放总是启用的,因此不需要设置Qt::AA_EnableHighDpiScaling属性。建议移除相关的代码以保持代码的简洁性。

  6. DNoTitlebarWindowHelper类中,windowEvent函数中使用了event->globalPos()来获取鼠标位置,但在Qt 6中,应该使用event->globalPosition().toPoint()来代替,以保持代码的兼容性。

  7. DPlatformWindowHelper类中,windowRedirectContent函数中使用了QVariant::Bool来检查redirectContent属性的值,但在Qt 6中,应该使用QMetaType::typeId()来代替,以保持代码的兼容性。

  8. DxcbXSettings类和DPlatformSettings类中,使用了Q_DECL_HIDDEN宏来隐藏这些类的实现细节。这可能会导致这些类在未来的Qt版本中不可用。建议重新考虑是否需要隐藏这些类的实现细节。

以上是针对代码审查意见的详细说明,希望能够对您有所帮助。

@deepin-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, mhduiy

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@18202781743 18202781743 merged commit 89ff382 into linuxdeepin:master Jul 28, 2025
21 of 22 checks passed
18202781743 pushed a commit to linuxdeepin/qt6platform-plugins that referenced this pull request Jul 28, 2025
Synchronize source files from linuxdeepin/qt5platform-plugins.

Source-pull-request: linuxdeepin/qt5platform-plugins#297
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants